<?php
	require_once($_SERVER["DOCUMENT_ROOT"]."/global.php");
	require_once($_SERVER["DOCUMENT_ROOT"]."/modules/security_mod.php");
	require_once($_SERVER["DOCUMENT_ROOT"]."/alerter/modules/account_mod.php");
	require_once($_SERVER["DOCUMENT_ROOT"]."/alerter/modules/alert_mod.php");

	SecurityMod::login();

	$level = $_SESSION["account"]->getAdvanced();
	if ($level != 1 && $_SESSION["account"]->getLevel() != "Admin")
		SecurityMod::logout();
	
	AlertMod::addSafeTile(
		new SafeTile(
			v($_REQUEST, "alerter"),
			v($_REQUEST, "sector"),
			v($_REQUEST, "coords"),
			v($_REQUEST, "comment")
		)
	);
	
	header('location: alerts.php');

?>